<% layout("/WEB-INF/view/console/skins/skin_2/layout_nonav.html", {}) {
%>
<h2 class="header-text"  style="padding-top: 60px;">
    商城系统
						<span class="sub-header">
						发货
						</span>
</h2>
<div class="row">
    <div class="col-md-12 column">
        <div class="row clearfix">
            <div class="col-md-3 column">
            </div>

            <div class="col-md-6 column">
                <form role="form" id="form" class="form-horizontal">

                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">订单编号</label>
                        <div class="col-sm-4">
                            <span >${orderInfo.orderNumber!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">运费</label>
                        <div class="col-sm-4">
                            <span class="label label-danger" >${orderInfo.orderFreight}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">订单总金额</label>
                        <div class="col-sm-4">
                            <span class="label label-danger" >${orderInfo.orderPrice}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">商品总金额</label>
                        <div class="col-sm-4">
                            <span class="label label-danger" >${orderInfo.orderGoodsPrice}</span>
                        </div>
                    </div>

                    <div class="form-group" >
                        <label class="col-sm-2 control-label">是否自提</label>
                        <div class="col-sm-6">
                            <label><input readonly  auto_name='boProxyOrder_takeTheir' type="radio"  name="takeTheir" value="1"/>是</label>
                            <label><input readonly   auto_name='boProxyOrder_takeTheir' type="radio"  name="takeTheir" value="0"/>否</label>

                        </div>
                    </div>
                    <script type="text/javascript">
                        $(function($){
                            $('input[auto_name="boProxyOrder_takeTheir"]').each(function(){
                                if('${orderInfo.takeTheir!}'==this.value){
                                    $(this).attr('checked','checked');
                                    if(this.value==1){
                                        $("#shippingInfoId").hide();
                                    }
                                }
                            });
                        });
                    </script>
                    <div id="shippingInfoId">
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人</label>
                        <div class="col-sm-4">
                            <span id="s_consigneeName">${shippingAddress.consignee!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人电话</label>
                        <div class="col-sm-4">
                            <span id="s_consigneePhone">${shippingAddress.phone!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">邮编</label>
                        <div class="col-sm-4">
                            <span id="s_shippingPostcode">${shippingAddress.postCode!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人地址</label>
                        <div class="col-sm-4">
                            <span id="s_shippingProvince">${shippingAddress.province!}</span>
                            <span id="s_shippingCity">${shippingAddress.city!}</span>
                            <span id="s_shippingCounty">${shippingAddress.county!}</span>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">收货人详细地址</label>
                        <div class="col-sm-4">
                            <textarea class="form-control" disabled="disabled" id="s_shippingDetailAddress">${shippingAddress.address!}</textarea>
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">快递公司</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressCompany" readonly id="expressCompany" class="form-control" check-type="required" value='${orderInfo.orderExpressCompany}' >
                        </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">快递单号</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressNumber" readonly id="expressNumber" class="form-control" check-type="required" value='${orderInfo.orderExpressNumber}' >
                        </div>
                    </div>
                    </div>
                    <div class="form-group clearfix">
                        <label class="col-xs-2 text-right">其他</label>
                        <div class="col-sm-4">
                            <input  type="text"  name="expressRemark" readonly id="expressRemark" class="form-control" check-type="required" value='${orderInfo.orderExpressRemark}' >
                        </div>
                    </div>
                </form>
            </div>
    </div>
        </div>
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-3 column">
            </div>
            <div class="col-md-6">
                <table class="table">
                    <thead>
                    <tr>
                        <th>商品名称</th>
                        <th>商品价格</th>
                        <th>商品图片</th>
                        <th>购买数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <% for (goodsInfo in orderGoodses){%>
                    <tr>
                        <td>${goodsInfo.orderGoodsTitle!}</td>
                        <td>${goodsInfo.orderGoodsPrice!}</td>
                        <td><img  style="width: 100px;" src="${ctxPath}${goodsInfo.orderGoodsImage!}"/></td>
                        <td>${goodsInfo.orderGoodsNumber!}</td>
                        <% if(orderInfo.orderType==4){%>
                        <td><button type="button" class="btn btn-danger btn-xs" o-id="${orderInfo.orderId}" g-id="${goodsInfo.orderGoodsId}" g-number="${goodsInfo.orderGoodsNumber}" onclick="tuihuo(this)">退货申请</button></td>
                        <% }%>
                    </tr>
                    <% }%>
                    </tbody>
                </table>
            </div>
    </div>
        </div>
    </div>
<div id="refundId" style="display: none">
    <div class="form-group clearfix">
        <label class="col-xs-4 text-right">数量</label>
        <div class="col-sm-8">
            <input  type="text"  id="refundNumber" class="form-control"   >
        </div>
        <label class="col-xs-4 text-right">原因</label>
        <div class="col-sm-8">
            <input  type="text"  id="rCase" class="form-control"   >
        </div>
        <label class="col-xs-4 text-right">备注</label>
        <div class="col-sm-8">
            <input  type="text"  id="notes" class="form-control"   >
        </div>
        <label class="col-xs-4 text-right"> </label>
        <div class="col-sm-8">
            <button id="shueButton" type="button" class="btn btn-danger btn-xs" o-id="" g-id="" g-number="" onclick="tuihuoShue(this)">确定</button>
        </div>

    </div>

</div>
<script>
    function tuihuo(e){
        var sb =  $("#shueButton");
        var tb=$(e);
       sb .attr("o-id",tb.attr("o-id"));
        sb .attr("g-id",tb.attr("g-id"));
        sb .attr("g-number",tb.attr("g-number"));
        art.dialog({
            id: "id-dialog-refundNumber",
            title: "退货",
            padding: 0,
            width:500,
            height:200,
            fixed: true,
            content:$("#refundId").html()
        });

    }
    function tuihuoShue(e){
        var refundNumber = $("#refundNumber").val();
        var s = $(e);
        $.post("/console/bo_proxy_order/refund",{rCase:$("#rCase").val(),notes:$("#notes").val(),orderId: s.attr("o-id"),orderGoodsId: s.attr("g-id"),refundGoodsNumber:refundNumber,proxyId:"${orderInfo.proxyId}"},function(data){
          if(data.http_status==1){
              $.alert({title:"提示",content:"退货申请成功"});
          }else{
              $.alert({title:"提示",content:data.message});
          }
        });
    }

</script>
<%} %>
